<div class="content">
	<div class="tab_bar">
		<ul>
			<li class="tab_index" onclick="setTabContent(this);">基本信息</li>
			<li onclick="setTabContent(this);">主题设置</li>
			<li onclick="setTabContent(this);">高级设置</li>
		</ul>
		<button class="btn_tabbar" onclick="submitActionForm(this);" return="system/siteinfo.do">保 存</button>
	</div>




	<form id="myForm" action="system/saveinfo.do" method="post" class="form-horizontal">


    <div class="tab_content">
		<div class="tab_item tab_show">

			<div class="control-group">
				<label class="control-label">站点名称：</label>
				<div class="controls">
					<input name="config.title" type="text" value="${config.title}"
						   placeholder="站点名称"/>
                    <div class="help-block">
                        网站标题
                    </div>
				</div>
			</div>

			<div class="control-group">
				<label class="control-label">站点地址：</label>
				<div class="controls">
					<input name="config.url" type="text" value="${config.url}"
						   placeholder="站点地址"/>
                    <div class="help-block">
                        网站访问地址
                    </div>
				</div>
			</div>

			<div class="control-group">
				<label class="control-label">网站关键字：</label>
				<div class="controls">
					<input name="config.keywords" type="text" value="${config.keywords}"
						   placeholder="网站关键字"/>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">网站描述：</label>
				<div class="controls">
					<textarea class="textarea_for_add" name="config.description" >${config.description}</textarea>
                    <div class="help-block">
                        该配置与网站SEO有关系
                    </div>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">站长邮箱：</label>
				<div class="controls">
					<input class="input_for_add" name="config.mastermail" type="text" value="${config.mastermail}"
						   placeholder="网站关键字"/>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">版权信息：</label>
				<div class="controls">
					<input class="input_for_add" name="config.copyright" type="text" value="${config.copyright}"
						   placeholder="网站关键字"/>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">ICP备案号：</label>
				<div class="controls">
					<input class="input_for_add" name="config.icp" type="text" value="${config.icp}"
						   placeholder="网站关键字"/>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">默认语言：</label>
				<div class="controls">
					${langselect!}
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">站内统计：</label>
				<div class="controls">
                    <#if config.statistics == 'true'>
                        <input id="statistics_1" name="config.statistics" type="checkbox" value="true" checked="checked" />
                    <#else>
                        <input id="statistics_2" name="config.statistics" type="checkbox" value="true" />
                    </#if>
				</div>
			</div>

			<div class="control-group">
				<label class="control-label">产品秘钥：</label>
				<div class="controls">
					<input class="input_for_add" type="text" value="${config.secret_key!}" disabled="disabled" />
				</div>
			</div>
		</div>
		<div class="tab_item">
                <div class="control-group">
                    <label class="control-label">主页地址：</label>
                    <div class="controls">
                        <input class="input_for_add" name="config.index_page" type="text" value="${config.index_page!}"  />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">异常模板：</label>
                    <div class="controls">
                        <input class="input_for_add" name="config.error_page" type="text" value="${config.error_page}"   />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">站点主题：</label>
                    <div class="controls">
                        <input id="themepath" class="input_for_add" name="config.themes_active" type="hidden" value="${config.themes_active}"  />

                        <div id="themes_select">

                        </div>
                    </div>
                </div>



                <div class="control-group">
                    <label class="control-label">主题缓存：</label>
                    <div class="controls">
                        <input class="input_for_add" name="config.themes_cache" type="text" value="${config.themes_cache}"    />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">开发模式：</label>
                    <div class="controls">

                        <#if config.dev_mode == 'true'>
                            <input id="mode_1" name="config.dev_mode" type="radio" value="true" checked="checked" /><label for="mode_1">&nbsp;是&nbsp; &nbsp;</label>
                            <input id="mode_2" name="config.dev_mode" type="radio" value="false" /><label for="mode_2">&nbsp;否&nbsp; &nbsp;</label>
                            <#else>
                                <input id="mode_1" name="config.dev_mode" type="radio" value="true" /><label for="mode_1">&nbsp;是&nbsp; &nbsp;</label>
                                <input id="mode_2" name="config.dev_mode" type="radio" value="false" checked="checked" /><label for="mode_2">&nbsp;否&nbsp; &nbsp;</label>
                        </#if>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">页面压缩：</label>
                    <div class="controls">
                        <#if config.gzip == 'true'>
                            <input id="gzip_1" name="config.gzip" type="radio" value="true" checked="checked" /><label for="gzip_1">&nbsp;是&nbsp; &nbsp;</label>
                            <input id="gzip_2" name="config.gzip" type="radio" value="false" /><label for="gzip_2">&nbsp;否&nbsp; &nbsp;</label>
                            <#else>
                                <input id="gzip_1" name="config.gzip" type="radio" value="true" /><label for="gzip_1">&nbsp;是&nbsp; &nbsp;</label>
                                <input id="gzip_2" name="config.gzip" type="radio" value="false" checked="checked" /><label for="gzip_2">&nbsp;否&nbsp; &nbsp;</label>
                        </#if>

                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">代码压缩：</label>
                    <div class="controls">
                        <#if config.compress == 'true'>
                            <input id="compress_1" name="config.compress" type="radio" value="true" checked="checked" /><label for="compress_1">&nbsp;是&nbsp; &nbsp;</label>
                            <input id="compress_2" name="config.compress" type="radio" value="false" /><label for="compress_2">&nbsp;否&nbsp; &nbsp;</label>
                            <#else>
                                <input id="compress_1" name="config.compress" type="radio" value="true" /><label for="compress_1">&nbsp;是&nbsp; &nbsp;</label>
                                <input id="compress_2" name="config.compress" type="radio" value="false" checked="checked" /><label for="compress_2">&nbsp;否&nbsp; &nbsp;</label>
                        </#if>

                    </div>
                </div>

                <div class="control-group">
                    <label class="control-label">页面静态化：</label>
                    <div class="controls">
                        <#if config.statichtml == 'true'>
                            <input id="statichtml_1" name="config.statichtml" type="radio" value="true" checked="checked" /><label for="statichtml_1">&nbsp;是&nbsp; &nbsp;</label>
                            <input id="statichtml_2" name="config.statichtml" type="radio" value="false" /><label for="statichtml_2">&nbsp;否&nbsp; &nbsp;</label>
                            <#else>
                                <input id="statichtml_1" name="config.statichtml" type="radio" value="true" /><label for="statichtml_1">&nbsp;是&nbsp; &nbsp;</label>
                                <input id="statichtml_2" name="config.statichtml" type="radio" value="false" checked="checked" /><label for="statichtml_2">&nbsp;否&nbsp; &nbsp;</label>
                        </#if>

                    </div>
                </div>

		</div>
		<div class="tab_item">



            <div class="control-group">
                <label class="control-label">上传存储路径：</label>
                <div class="controls">
                    <input name="config.filePath" type="text" value="${config.file_path!}"/>
                    <div class="help-block">注意：上传文件存储路径需要配置Nginx代理访问CSS、图片等文件! </div>
                    <span class="tip_text"></span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">主题存储路径：</label>
                <div class="controls">
                    <input name="config.themesPath" type="text" value="${config.themes_path!}" />
                    <div class="help-block">注意：主题存储路径需要配置Nginx代理访问CSS、图片等文件!</div>
                    <span class="tip_text"></span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">登录安全码：</label>
                <div class="controls">
                    <input name="config.loginSafe" type="text" value="${config['system.login.safe']!}"  />
                    <div class="help-block">例如  安全码为：123，则登录地址为：login.do?safe=123</div>
                    <span class="tip_text"></span>
                </div>
            </div>
		</div>
	</div>	
	</form>  
</div>


<script type="text/javascript">


$(function(){
	$("#selectLanguage").val('${config.defaultlang!}');



	
	$.ajax({
		url:"system/themes.do",
		type:"get", 
		dataType:"json",
		success:function(data){ 
			
			var source   = $("#entry-template").html();
			var template = Handlebars.compile(source);
			
			var html    = template({"themesdata": data});
			$("#themes_select").html(html);
			
			
			// 初始化当前主题
			var path = $("#themepath").val();
			$(".theme_item").each(function(){ 
				var _path = $(this).attr("path");
				if(path == _path){
					$(this).addClass("theme_item_border");
				}
			});
			
			
		} 
	});
	
	$("#themes_select").on("click", ".theme_item",function(){
		$(".theme_item").each(function(){
			$(this).removeClass("theme_item_border");
		});
		
		$(this).addClass("theme_item_border");
		$("#themepath").val($(this).attr("path"));
	}); 
});





</script>


<script id="entry-template" type="text/x-handlebars-template">
{{#each themesdata}}
<div class="theme_item" title="作者:{{author}}" path="{{path}}">	
   <img width="150" height="150" src="{{icon}}" />
   <div class="infobg"></div>
   <div class="info">{{name}}</div>
</div>
{{/each}} 
</script>